<include file="Public:header" />
<div id="main" class="main" >
<div class="content">
<div class="title">添加试题 [ <a href="__URL__">返回列表</a> ]</div>
<div id="result" class="result none"></div>
<form method='post' id="form1" name="form1" action="__URL__/insert"  enctype="multipart/form-data">
<table cellpadding=3 cellspacing=3>
<tr>
	<td class="tRight" width="10%">试题名称：</td>
	<td class="tLeft" ><input type="text" class="huge bLeftRequire" name="title"></td>
</tr>
<tr>
	<td class="tRight" width="18%">分类：</td>
	<td class="tLeft" >
		<select name="type" onchange="displayarea(this.options[this.options.selectedIndex].value)">
		<option value="1">单选</option>
		<option value="2">多选</option>
        <option value="3">是非</option>
		</select>
	</td>
</tr>
</table>
<div id="radioArea" style="display:block">
<table>
<tr>
	<td class="tRight tTop">单选答案一：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option1">&nbsp;&nbsp;<input type="radio" name="answer" value="0" />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">单选答案二：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option2">&nbsp;&nbsp;<input type="radio" name="answer" value="1" />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">单选答案三：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option3">&nbsp;&nbsp;<input type="radio" name="answer" value="2" />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">单选答案四：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option4">&nbsp;&nbsp;<input type="radio" name="answer" value="3" />正确答案</td>
</tr>
</table>
</div>
<div id="boolArea" style="display:none">
<table>
<tr>
	<td class="tRight tTop">是非题选项一：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option1" value="是">&nbsp;&nbsp;<input type="radio" name="answer" value="0" />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">是非题选项二：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option2" value="否">&nbsp;&nbsp;<input type="radio" name="answer" value="1" />正确答案</td>
</tr>
</table>
</div>
<div id="checkboxArea" style="display:none">
<table>
<tr>
	<td class="tRight tTop">多选答案一：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="moption1">&nbsp;&nbsp;<input type="checkbox" name="manswer[]" value="0" />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">多选答案二：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="moption2">&nbsp;&nbsp;<input type="checkbox" name="manswer[]" value="1" />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">多选答案三：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="moption3">&nbsp;&nbsp;<input type="checkbox" name="manswer[]" value="2" />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">多选答案四：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="moption4">&nbsp;&nbsp;<input type="checkbox" name="manswer[]" value="3" />正确答案</td>
</tr>
</table>
</div>

<tr>
	<td></td>
	<td class="center"><div style="width:85%;margin:5px">
	<input type="hidden" name="status" value="1">
    <input type="hidden" name="user_id" value="<?php echo $_SESSION[C('USER_AUTH_KEY')] ?>">
	<input type="submit" value="保 存"  class="button small"> <input type="reset" class="button small" onclick="resetEditor()" value="重 置" >
	</div></td>
</tr>
</form>
</table>
</div>
</div>
<script>
function displayarea(id){
    var areaId = id;
    var radioArea = document.getElementById('radioArea');
    var checkboxArea = document.getElementById('checkboxArea');
	var boolArea = document.getElementById('boolArea');
    if(areaId == 1){
	    radioArea.style.display = 'block';
	    checkboxArea.style.display = 'none';
		boolArea.style.display = 'none';
    }else if(areaId ==2){
	    checkboxArea.style.display = 'block';
	    radioArea.style.display = 'none';
		boolArea.style.display = 'none';
	}else if(areaId ==3){
		boolArea.style.display = 'block';
	    checkboxArea.style.display = 'none';
	    radioArea.style.display = 'none';
	}
}
</script>
